﻿<%@ Page Title="Pages" Language="C#" Theme="WebAdmin" MasterPageFile="~/WebAdmin/WebAdmin.master"
    AutoEventWireup="true" CodeFile="ManagePages.aspx.cs" Inherits="WebAdmin_ManageContentPages" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="submenu">
        <div align="right" class="smallgraytext" style="padding: 9px;">
            <a href="AddPage.aspx" >Create New Page</a>
        </div>
    </div>
    <div id="contenttext">
        <div style="padding: 0px 10px 10px 10px">
            <div style="text-align: left;">
                <table width="100%">
                    <tr>
                        <td valign="top">
                            <h3 style="margin-top:0px;">
                                List of Pages</h3>
                            <asp:GridView ID="GVPages" Width="100%" AutoGenerateColumns="False" runat="server"
                                CssClass="GridViewStyle" AllowSorting="true" GridLines="None">
                                <Columns>
                                    <asp:BoundField DataField="MasterPageName" HeaderText="Template Name" />
                                    <asp:BoundField DataField="FileName" HeaderText="FileName" />
                                    <asp:BoundField DataField="Title" HeaderText="Title" />
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderText="Home Page">
                                        <ItemTemplate>
                                            <a href="ManagePages.aspx?Type=HomePage&Id=<%#Eval("Id") %>" ><img alt="Layout" title="Layout" src="<%#IsHomePage(Convert.ToString(Eval("Id"))) %>"></img></a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderText="Layout">
                                        <ItemTemplate>
                                            <a href="<%#PageURL(true,Convert.ToString(Eval("FileName"))) %>" ><img alt="HomePage" title="HomePage" src="../App_Themes/WebAdmin/buttons/layout.png" width="24" height="24" ></img></a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderText="View">
                                        <ItemTemplate>
                                            <a href="<%#PageURL(false,Convert.ToString(Eval("FileName"))) %>" ><img alt="View" title="View" src="../App_Themes/WebAdmin/buttons/view_gallery.png" width="24" height="24"  ></img></a>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderText="Edit">
                                        <ItemTemplate>
                                            <a href="AddPage.aspx?Id=<%#Eval("Id") %>&PageLanguageId=<%#Eval("PageLanguageId") %>"><img alt="Edit Page" title="Edit Page" src="../App_Themes/WebAdmin/buttons/page_white_edit.png"  width="24" height="24" ></img></a></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderText="Delete">
                                        <ItemTemplate>
                                            <a onclick="return confirm('Are you sure want to delete this page?')" href="ManagePages.aspx?Type=Delete&Id=<%#Eval("Id") %>"><img alt="Delete Page" title="Delete Page" src="../App_Themes/WebAdmin/buttons/page_delete.png" width="24" height="24"  ></img></a></ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <RowStyle  CssClass="RowStyle" />
                                <EmptyDataRowStyle CssClass="EmptyRowStyle" />
                                <PagerStyle CssClass="PagerStyle" />
                                <SelectedRowStyle CssClass="SelectedRowStyle" />
                                <HeaderStyle CssClass="HeaderStyle" />
                                <EditRowStyle CssClass="EditRowStyle" />
                                <AlternatingRowStyle CssClass="AltRowStyle" />
                                <EmptyDataTemplate>No Pages</EmptyDataTemplate>
                            </asp:GridView>
                        </td>
                       
                    </tr>
                </table>
            </div>
        </div>
    </div>
</asp:Content>
